home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 13XY4BU (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  2.4 KB  |  52 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import com.sun.java.swing.event.DocumentEvent;
  4. import com.sun.java.swing.event.DocumentListener;
  5. import com.sun.java.swing.text.Document;
  6. import java.awt.Rectangle;
  7. import java.beans.PropertyChangeEvent;
  8. import java.beans.PropertyChangeListener;
  9.  
  10. class BasicTextUI$UpdateHandler implements PropertyChangeListener, DocumentListener {
  11.    // $FF: synthetic field
  12.    BasicTextUI this$0;
  13.  
  14.    public final void propertyChange(PropertyChangeEvent evt) {
  15.       Object oldValue = evt.getOldValue();
  16.       Object newValue = evt.getNewValue();
  17.       if (oldValue instanceof Document || newValue instanceof Document) {
  18.          if (oldValue != null) {
  19.             ((Document)oldValue).removeDocumentListener(this);
  20.          }
  21.  
  22.          if (newValue != null) {
  23.             ((Document)newValue).addDocumentListener(this);
  24.          }
  25.  
  26.          this.this$0.modelChanged();
  27.       }
  28.  
  29.       this.this$0.propertyChange(evt);
  30.    }
  31.  
  32.    public final void insertUpdate(DocumentEvent e) {
  33.       Rectangle alloc = this.this$0.painted ? new Rectangle(this.this$0.editor.getSize()) : null;
  34.       this.this$0.rootView.insertUpdate(e, alloc, this.this$0.rootView.getViewFactory());
  35.    }
  36.  
  37.    public final void removeUpdate(DocumentEvent e) {
  38.       Rectangle alloc = this.this$0.painted ? new Rectangle(this.this$0.editor.getSize()) : null;
  39.       this.this$0.rootView.removeUpdate(e, alloc, this.this$0.rootView.getViewFactory());
  40.    }
  41.  
  42.    public final void changedUpdate(DocumentEvent e) {
  43.       Rectangle alloc = this.this$0.painted ? new Rectangle(this.this$0.editor.getSize()) : null;
  44.       this.this$0.rootView.changedUpdate(e, alloc, this.this$0.rootView.getViewFactory());
  45.    }
  46.  
  47.    // $FF: synthetic method
  48.    BasicTextUI$UpdateHandler(BasicTextUI this$0) {
  49.       this.this$0 = this$0;
  50.    }
  51. }
  52.